home *** CD-ROM | disk | FTP | other *** search
| Text File | 1988-04-12 | 1.3 KB | 55 lines | [TEXT/PJMM] |
- UNIT ModKeys;
-
- INTERFACE
-
- VAR
- MyKeys : KeyMap;
-
- FUNCTION CommandIsDown : Boolean; { check the Command key to see if pressed . }
- FUNCTION OptionIsDown : Boolean; { Check the Option key to see if pressed .}
- FUNCTION CapsIsDown : Boolean; { Check the Caps Lock key to see if pressed . }
- FUNCTION ShiftIsDown : Boolean; { Check the Shift key to see if pressed . }
-
- IMPLEMENTATION
- {-------------------------------------------------}
- FUNCTION CommandIsDown;
-
- BEGIN
- CommandIsDown := False;
- GetKeys(MyKeys);
- IF BitTst(@MyKeys[1], 16) THEN {16 = Command key pressed}
- CommandIsDown := True;
- END;
-
- {---------------------------------------------------}
- FUNCTION OptionIsDown;
-
- BEGIN
- OptionIsDown := False;
- GetKeys(MyKeys);
- IF BitTst(@MyKeys[1], 29) THEN {29 = Option key pressed}
- OptionIsDown := True;
- END;
-
- {---------------------------------------------------}
- FUNCTION CapsIsDown;
-
- BEGIN
- CapsIsDown := False;
- GetKeys(MyKeys);
- IF BitTst(@MyKeys[1], 30) THEN {30 = CapsLock key pressed}
- CapsIsDown := True;
- END;
-
- {---------------------------------------------------}
- FUNCTION ShiftIsDown;
-
- BEGIN
- ShiftIsDown := False;
- GetKeys(MyKeys);
- IF BitTst(@MyKeys[1], 31) THEN {31 = Shift key pressed}
- ShiftIsDown := True;
- END;
-
- {----------------------------------------------------}
- END. { of unit }